package com.dg.jwt;

import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;

public class ParseJwtTest3 {
    public static void main(String[] args) {
        String codo = "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI4ODgiLCJzdWIiOiLlsI_pu5EiLCJpYXQiOjE1NDIxODI4MDYsImV4cCI6MTU0MjE4Mjg2Niwicm9sZSI6ImFkbWluIiwibG9nbyI6IjEuanBnIn0.DX9M6mPXxVlG8fbTwM8aHGDyqT9i8RSwCLvExDZ1a8I";
        Claims claims = Jwts.parser().setSigningKey("itheima").parseClaimsJws(codo).getBody();
        System.out.println(claims.getId());
        System.out.println(claims.getSubject());
        System.out.println(claims.getIssuedAt());
        System.out.println(claims.getExpiration());
        System.out.println(claims.get("role"));
        System.out.println(claims.get("logo"));
    }
}
